package com.ts.content.controller;

import com.ts.common.core.utils.Result;
import com.ts.content.entity.UserLoginEntity;
import com.ts.content.service.UserLoginService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 用户登录表
 *
 * @author toString toString@qq.com
 * @since 1.0.0 2023-03-02
 */
@RestController
@RequestMapping("/userOperation")
@Api(tags = "用户登录表")
public class UserLoginController {
    @Autowired
    private UserLoginService userLoginService;


    @GetMapping("/get")
    public Result getUser() {
        List<UserLoginEntity> list = userLoginService.list();
        return new Result().ok(list);
    }

    @PostMapping("/add")
    public Result addUserOpe(@RequestBody UserLoginEntity userLoginEntity){
        boolean res = userLoginService.save(userLoginEntity);
        return new Result().viewOk(res);
    }

}